package com.direct.domian;

import java.util.HashSet;
import java.util.Set;

/**
 * 权限
 * 
 * @author Administrator
 * 
 */
public class Power {

	private String id;
	private Power power;
	private String name;
	private String remark;
	private Integer powerLevel;
	private String powerValue;
	private Integer isMenu;
	private Integer order;
	// 如果为父权所拥有的子权限
	private Set powers = new HashSet(0);

	public Power() {
	}

	public Power(String id) {
		this.id = id;
	}

	public Power(String id, Power power, String name, String remark,
			Integer powerLevel, String powerValue, Integer isMenu, Integer order,
			Set powers) {
		this.id = id;
		this.power = power;
		this.name = name;
		this.remark = remark;
		this.powerLevel = powerLevel;
		this.powerValue = powerValue;
		this.isMenu = isMenu;
		this.order = order;
		this.powers = powers;
	}

	public String getId() {
		return id;
	}

	public Integer getIsMenu() {
		return isMenu;
	}

	public String getName() {
		return name;
	}

	public Integer getOrder() {
		return order;
	}

	public Power getPower() {
		return power;
	}

	public Integer getPowerLevel() {
		return powerLevel;
	}

	public Set getPowers() {
		return powers;
	}

	public String getPowerValue() {
		return powerValue;
	}

	public String getRemark() {
		return remark;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setIsMenu(Integer isMenu) {
		this.isMenu = isMenu;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setOrder(Integer order) {
		this.order = order;
	}

	public void setPower(Power power) {
		this.power = power;
	}

	public void setPowerLevel(Integer powerLevel) {
		this.powerLevel = powerLevel;
	}

	public void setPowers(Set powers) {
		this.powers = powers;
	}

	public void setPowerValue(String powerValue) {
		this.powerValue = powerValue;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Power other = (Power) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	

}